<template>
	<view class="projectDetails">
		<!-- <f-navbar title="维保详情（维保）" :iconLeft="true" :isBack="true" @goBack="goBack" /> -->
		<view class="projectDetails-header" :style="tabberStyle">
			<view class="ff-bg-blue">
				<image class="projectDetails-header-bg"
					src="https://fire-system.oss-cn-beijing.aliyuncs.com/web/fire-technology/compang-details-bg.png"
					mode="">
				</image>
				<view class="projectDetails-header-content ff-bg-fff ff-border-radius-10">
					<view class="ff-font-16 ff-font-weight-600 ff-color-000 ff-margin-bottom-5">
						{{ maintenanceDetails.projectName }}
					</view>
					<view class="ff-align-items-one ff-flex-wrap">
						<view class="ff-margin-right-10">
							<view v-if="maintenanceDetails.status == 0" class="tips1 ff-font-12">项目状态&nbsp;|&nbsp;已发布
							</view>
							<view v-if="maintenanceDetails.status == 1" class="tips1 ff-font-12">项目状态&nbsp;|&nbsp;已响应
							</view>
							<view v-if="maintenanceDetails.status == 2" class="tips1 ff-font-12">项目状态&nbsp;|&nbsp;已确认
							</view>
							<view v-if="maintenanceDetails.status == 3" class="tips1 ff-font-12">项目状态&nbsp;|&nbsp;进行中
							</view>
							<view v-if="maintenanceDetails.status == 4" class="tips1 ff-font-12">项目状态&nbsp;|&nbsp;已结束
							</view>
							<view v-if="maintenanceDetails.status == 5" class="tips1 ff-font-12">项目状态&nbsp;|&nbsp;待批准
							</view>
							<view v-if="maintenanceDetails.status == 6" class="tips5 ff-font-12">项目状态&nbsp;|&nbsp;已解约
							</view>
							<view v-if="maintenanceDetails.status == 9" class="tips5 ff-font-12">项目状态&nbsp;|&nbsp;已作废
							</view>
						</view>
						<view v-if="maintenanceDetails.status == 3" class="ff-margin-right-10">
							<view v-if="maintenanceDetails.maintenances[0].status == 0" class="tips2 ff-font-12">
								维保状态&nbsp;|&nbsp;待维保</view>
							<view v-if="maintenanceDetails.maintenances[0].status == 1" class="tips2 ff-font-12">
								维保状态&nbsp;|&nbsp;维保中</view>
							<view v-if="maintenanceDetails.maintenances[0].status == 2" class="tips2 ff-font-12">
								维保状态&nbsp;|&nbsp;待审核</view>
							<view v-if="maintenanceDetails.maintenances[0].status == 3" class="tips2 ff-font-12">
								维保状态&nbsp;|&nbsp;待签发</view>
							<view v-if="maintenanceDetails.maintenances[0].status == 5" class="tips2 ff-font-12">
								维保状态&nbsp;|&nbsp;已完成</view>
							<view v-if="maintenanceDetails.maintenances[0].status == 6" class="tips2 ff-font-12">
								维保状态&nbsp;|&nbsp;已驳回</view>
							<view v-if="maintenanceDetails.maintenances[0].status == 7" class="tips2 ff-font-12">
								维保状态&nbsp;|&nbsp;待指派</view>
							<view v-if="maintenanceDetails.maintenances[0].status == 8" class="tips2 ff-font-12">
								维保状态&nbsp;|&nbsp;待提交</view>
							<view v-if="maintenanceDetails.maintenances[0].status == 9" class="tips5 ff-font-12">
								维保状态&nbsp;|&nbsp;已作废</view>
						</view>
						<view v-if="maintenanceDetails.rescissionStatus == 1"
							class="tips4 ff-color-fff ff-font-12 ff-margin-right-10">解约确认中</view>
						<view class="ff-flex-wrap">
							<view class="tips3 ff-font-12 ff-margin-right-10" v-if="maintenanceDetails.doneNumber > 0">
								已完成{{ maintenanceDetails.doneNumber }}次执业</view>
							<view
								v-if="maintenanceDetails.rescissionStatus == 0 || maintenanceDetails.rescissionStatus == 1"
								class="ff-align-items">
								<view v-if="roleStatus == 2 && maintenanceDetails.maintenances[0].status == 7">
									<view class="tips3 ff-font-12"
										v-if="maintenanceDetails.doneNumber + maintenanceDetails.cancelNumber + 1 > 0">
										正在进行第{{ maintenanceDetails.doneNumber + maintenanceDetails.cancelNumber + 1 }}次指派
									</view>
								</view>
							</view>
							<view
								v-if="maintenanceDetails.maintenances[0].status == 0 || maintenanceDetails.maintenances[0].status == 1 || maintenanceDetails.maintenances[0].status == 2 || maintenanceDetails.maintenances[0].status == 3"
								class="ff-align-items">
								<view class="tips3 ff-font-12"
									v-if="maintenanceDetails.doneNumber + maintenanceDetails.cancelNumber + 1 > 0">
									正在进行第{{ maintenanceDetails.doneNumber + maintenanceDetails.cancelNumber + 1 }}次执业
								</view>
							</view>
						</view>
					</view>
					<view class="ff-font-13 projectDetails-header-content-address ff-line-height-1-3 ff-flex">
						<view>社会单位：</view>
						<view>{{ maintenanceDetails.companyName || '/' }}</view>
					</view>
					<view class="ff-font-13 projectDetails-header-content-address ff-line-height-1-3 ff-flex">
						<view>单位地址：</view>
						<view>{{ maintenanceDetails.companyAddr || '/' }}</view>
					</view>
					<view class="ff-font-13 projectDetails-header-content-address ff-line-height-1-3 ff-flex">
						<view>项目地址：</view>
						<view>{{ maintenanceDetails.projectAddr }} | 距离您{{ maintenanceDetails.nearest || '0' }}km</view>
					</view>
					<view class="ff-font-13 projectDetails-header-content-time ff-flex">
						<view>
							更 新 于：
						</view>
						<view>
							{{ maintenanceDetails.modified == null ? '/' : maintenanceDetails.modified.substr(0, maintenanceDetails.modified.length - 3) }}
						</view>
					</view>
					<view
						:class="{ oneBUt: maintenanceDetails.rescissionStatus !== 0 && maintenanceDetails.rescissionStatus !== 1 && maintenanceDetails.rescissionStatus !== 2 }"
						class="projectDetails-header-content-but ff-flex-around ff-margin-top-20 ff-margin-bottom-5">
						<u-button v-if="maintenanceDetails.rescissionStatus == 0 && roleStatus == 2"
							@click="launchRescindClick" type="primary" size="medium" plain>解约合同</u-button>
						<view v-if="maintenanceDetails.rescissionStatus == 1 && roleStatus == 2">
							<u-button v-if="maintenanceDetails.rescissionPromoterStatus == 1"
								@click="cancelRescindClick" size="medium" plain>取消解约</u-button>
							<u-button v-else @click="confirmRescindClick" size="medium" plain>确定解约</u-button>
						</view>
						<u-button v-if="maintenanceDetails.rescissionStatus == 2" size="medium" plain>解约完成</u-button>
						<u-button @click="demandDetailsClick" type="primary" size="medium">查看需求详情</u-button>
					</view>
					<view v-if="maintenanceDetails.rescissionStatus == 1">
						<view v-if="maintenanceDetails.rescissionPromoterStatus == 1"
							class="projectDetails-header-content-noResult ff-align-items-one ff-line-height-1-3 ff-font-13 ff-border-radius-5 ff-padding-10">
							<view><u-icon name="info-circle" color="#FF0000" size="43"></u-icon></view>
							<view class="ff-margin-left-5">您已申请解约合同，需要对方同意。如有问题，请联系对方负责人！</view>
						</view>
						<view v-if="maintenanceDetails.rescissionPromoterStatus == 2"
							class="projectDetails-header-content-noResult ff-align-items-one ff-line-height-1-3 ff-font-13 ff-border-radius-5 ff-padding-10">
							<view><u-icon name="info-circle" color="#FF0000" size="43"></u-icon></view>
							<view class="ff-margin-left-5">请注意，社会单位已对本项目发起解约申请，如有异议，请尽快与社会单位联系。</view>
						</view>
					</view>

				</view>
				<!-- 合同编号 -->
				<view
					class="projectDetails-contract ff-padding-15 ff-bg-fff ff-border-radius-10 ff-flex-between ff-align-items-one">
					<view class="ff-font-16 ff-font-weight-600 ff-color-111 ff-width-110">维护合同编号</view>
					<view @click.stop="projectCodeClick" class="ff-flex ff-text-right">
						<view v-if="!maintenanceDetails.projectCode" class="ff-color-999 ff-width-180">请维护合同编号</view>
						<view class="ff-width-180" v-else>{{ maintenanceDetails.projectCode }}</view>
						<u-icon name="arrow-right" color="#AAAAAA" size="28"></u-icon>
					</view>
				</view>
				<!-- 解约记录 -->
				<view class="projectDetails-termrecord ff-bg-fff ff-border-radius-10"
					v-if="maintenanceDetails.rescissionStatus != 0">
					<view class="ff-font-16 ff-font-weight-600">解约记录</view>
					<view>
						<view class="ff-flex">
							<view class="ff-color-999">发起方</view>
							<view>{{rescissionInfo.rescissionPromoteParty ||'--'}}</view>
						</view>
						<view class="ff-flex">
							<view class="ff-color-999">发起人</view>
							<view>{{rescissionInfo.rescissionPromoterName ||'--'}}</view>
						</view>
						<view class="ff-flex">
							<view class="ff-color-999">发起时间</view>
							<view>{{rescissionInfo.rescissionPromoteDate ||'--'}}</view>
						</view>
						<view class="ff-flex">
							<view class="ff-color-999">解约原因</view>
							<view style="width: 60%;">{{rescissionInfo.rescissionReason ||'--'}}</view>
						</view>
						<view class="ff-flex">
							<view class="ff-color-999">确认解约人</view>
							<view>{{rescissionInfo.rescissionConfirmName ||'--'}}</view>
						</view>
						<view class="ff-flex">
							<view class="ff-color-999">确认解约时间</view>
							<view>{{rescissionInfo.rescissionConfirmDate ||'--'}}</view>
						</view>
					</view>
				</view>
				<!-- 维保记录 -->
				<view class="ff-bg-f5 ff-padding-bottom-10">
					<view class="projectDetails-content ff-bg-fff ff-border-radius-10">
						<view
							class="projectDetails-content-title ff-font-16 ff-font-weight-600 ff-color-111 ff-margin-bottom-16">
							维保记录</view>
						<view>
							<u-time-line>
								<u-time-line-item nodeTop="7" v-for="(item, index) of maintenanceDetails.maintenances"
									:key="index">
									<template v-slot:content>
										<view v-if="maintenanceDetails.maintenances">
											<view class="ff-margin-bottom-15 reportTime ff-font-13"
												v-if="maintenanceDetails.maintenances.length > 0">
												第{{ maintenanceDetails.maintenances.length - index }}次维保，开始时间：{{ item.startTime != null ? item.startTime : '/' }}
											</view>
											<view
												v-if="item.status == 0 || item.status == 1 || item.status == 2 || item.status == 3 || item.status == 6 || item.status == 8 || item.status == 9"
												class="reportBut ff-margin-bottom-18">
												<u-button @click.stop="mechanismDetailsClick(item)" type="warning"
													size="medium" plain>维保详情</u-button>
											</view>
											<view v-if="item.status == 5" class="reportBut ff-margin-bottom-18">
												<u-button @click.stop="vieWReportClick(item)" type="warning"
													size="medium" plain>查看报告书</u-button>
											</view>
											<view v-if="item.status !== 5 && item.status !== 9 && roleStatus == 2">
												<u-button @click.stop="voidMechanismClick(item)" type="error"
													size="medium" plain>作废本次维保</u-button>
											</view>
										</view>
									</template>
								</u-time-line-item>
								<u-time-line-item nodeTop="7">
									<template v-slot:content>
										<view>
											<view class="reportTime ff-font-13">
												<text class="ff-margin-right-5">响应成功：</text>
												{{ maintenanceDetails.contractTime || '' }}
											</view>
										</view>
									</template>
								</u-time-line-item>
							</u-time-line>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view
			v-if="maintenanceDetails.status == 3 && (maintenanceDetails.maintenances[0].status == 5 || maintenanceDetails.maintenances[0].status == 9)"
			class="projectDetails-bottomBbut">
			<u-button type="primary" v-if="roleStatus == 2"
				@click="launchMechanismClick">发起第{{ maintenanceDetails.maintenceNum + 1 }}次维保</u-button>
		</view>
		<!-- 解约合同弹框 -->
		<u-modal v-model="terminationModal" title="请输入解约原因" show-cancel-button="true"
			:content-style="{ 'line-height': '1.5' }" @cancel="terminationCancel" @confirm="terminationConfirm">
			<view class="slot-content ff-padding-15">
				<view class="ff-font-13 ff-margin-bottom-10">发起解约后，需要等对方单位人同意后，方可解约成功。解约成功后的项目不可再进行维保。</view>
				<textarea v-model.trim="rescissionReason" maxlength="-1"
					class="ff-border-radius-5 ff-padding-5 ff-font-14" placeholder="*请输入"></textarea>
			</view>
		</u-modal>
		<!-- 确认解约合同弹框 -->
		<u-modal v-model="confirmRescindModal" show-cancel-button="true" @confirm="confirmRescindConfirm" title="温馨提示"
			:content-style="{ 'line-height': '1.5' }" content="项目解约后，不再支持任何操作。如有正在执业的人员，也将被强制暂停，请确认是否解约?" />
		<!-- 取消解约合同弹框 -->
		<u-modal v-model="cancelRescindModal" show-cancel-button="true" @confirm="cancelRescindConfirm" title="温馨提示"
			:content-style="{ 'line-height': '1.5' }" content="请确认是否取消解约合同？" />
		<!-- 报告书弹框 -->
		<u-modal v-model="reportModal" title="温馨提示" :content-style="{ 'line-height': '1.5' }"
			content="报告书正在生成，请稍后查看!" />
		<!-- 作废维保弹框 -->
		<u-modal v-model="voidModal" title="请输入作废原因" show-cancel-button="true" :content-style="{ 'line-height': '1.5' }"
			@confirm="voidConfirm">
			<view class="slot-content ff-padding-15">
				<view class="ff-font-13 ff-margin-bottom-10">作废本次维保后，数据清零且无法恢复，正在执业的人员将被强制暂停，请确认是否作废本次维保？</view>
				<textarea v-model.trim="reason" maxlength="-1" class="ff-border-radius-5 ff-padding-5 ff-font-14"
					placeholder="*请输入"></textarea>
			</view>
		</u-modal>
		<!-- 发起维保成功，管理员指派 -->
		<u-modal v-model="launchModal" title="温馨提示" show-cancel-button="true" :content-style="{ 'line-height': '1.5' }"
			content="发起维保任务成功, 请管理员指派任务后开始维保!" @confirm="launchConfirm" />
		<u-back-top :scrollTop="scrollTopList.scrollTop" top="200" mode="circle" :iconStyle="scrollTopList.iconStyle"
			:customStyle="scrollTopList.customstyle"></u-back-top>
		<u-toast ref="uToast" />
		<f-loading ref="loading" />
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex';
	export default {
		name: 'projectMaintenanceRecord',
		data() {
			return {
				rescissionInfo: {}, // 解约记录数据
				confirmRescindModal: false, // 确认解约合同显隐（单位发起）
				cancelRescindModal: false, // 取消解约合同弹窗显隐(机构发起的)
				rescissionReason: '', // 解约原因
				terminationModal: false, // 机构发起解约--弹窗显/隐
				reportModal: false, // 报告书弹框显/隐
				voidModal: false, // 作废维保弹框显/隐
				reason: '', // 作废原因
				launchModal: false, // 发起维保弹框显/隐
				voidId: '', // 作废维保的id
				// 返回顶部组件参数
				scrollTopList: {
					scrollTop: 0,
					iconStyle: {
						fontSize: '32rpx',
						color: '#FFFFFF'
					},
					customstyle: {
						background: '#3B83FE'
					}
				},
				// 获取维保详情页请求的参数
				params: {
					projectId: '',
					longitude: '',
					latitude: ''
				},
				maintenanceDetails: {}, // 维保详情页数据
			};
		},
		onPageScroll(e) {
			this.scrollTopList.scrollTop = e.scrollTop;
		},
		onLoad(e) {
			// console.log('前页面传过来的数据------', e);
			this.params.projectId = e.id;
			this.getMaintenanceDetails(e.id); // 获取维保详情页数据
		},
		onShow() {
			this.getMaintenanceDetails(this.params.projectId); // 获取维保详情页数据
		},
		computed: {
			// 用户角色状态
			...mapState({
				roleStatus: modules => modules.infoList.roleStatus
			}),
			tabberStyle() {
				return `top:${this.customBar}px;`;
			},
			paddingTop() {
				return `padding-top:${this.customBar}px;`;
			}
		},
		methods: {
			// 返回首页
			goBack() {
				this.$pageJump.reLaunch('/pages/maintenance/mechanism/Maintenance');
			},
			// 获取维保详情页数据
			async getMaintenanceDetails(id) {
				this.$refs.loading.openLoading('加载中···');
				const data = await this.$http.get({
					url: `/serviceOrg/project/detail/${id}`
				});
				// console.log('获取维保详情页数据------', data);
				if (data.code == 200) {
					this.maintenanceDetails = data.data;
					if (this.maintenanceDetails.rescissionStatus != 0) {
						this.getRescissionInfo(id) // 获取解约合同信息
					}
				} else {
					this.$refs.uToast.show({
						title: data.msg,
						type: 'error'
					});
				}
				this.$refs.loading.closeLoading();
			},
			// 获取解约合同信息
			async getRescissionInfo(id) {
				this.$refs.loading.openLoading('加载中···');
				const data = await this.$http.post({
					url: `/project/rescission/info/${id}`
				});
				// console.log('获取解约合同的数据------', data);
				if (data.code == 200) {
					this.rescissionInfo = data.data;
				}
				this.$refs.loading.closeLoading();
			},
			// 跳转到维护编号页面
			projectCodeClick() {
				if (this.roleStatus == 2) {
					this.$pageJump.navigateTo(
						'/pages/maintenance/mechanism/home/components/details/components/maintainProjectCode?projectId=' +
						this.maintenanceDetails.id +
						'&projectCode=' +
						this.maintenanceDetails.projectCode
					);
				} else {
					uni.showModal({
						title: '温馨提示',
						content: '请联系机构管理员维护合同编号',
						confirmColor: '#3178FF',
						showCancel: false,
						success: function(res) {
							if (res.confirm) {}
						},
					})
				}
			},
			// 发起解约--------机构
			launchRescindClick() {
				this.terminationModal = true
			},
			// 发起解约--------机构：确定
			async terminationConfirm() {
				if (!this.rescissionReason) {
					this.$refs.uToast.show({
						title: '请输入解约原因',
						type: 'error'
					});
					this.terminationModal = true
					return
				}
				this.$refs.loading.openLoading('解约中···');
				const data = await this.$http.post({
					url: `/project/rescissionV2`,
					data: {
						projectId: this.maintenanceDetails.id,
						rescissionReason: this.rescissionReason
					}
				});
				// console.log('机构解约合同）-----', data);
				this.rescissionReason = ''
				if (data.code == 200) {
					this.$refs.uToast.show({
						title: data.msg,
						type: 'success'
					});
					this.getMaintenanceDetails(this.maintenanceDetails.id); // 获取维保详情页数据
				} else {
					uni.showModal({
						title: '温馨提醒',
						content: data.msg,
						showCancel: false,
						confirmColor: '#3178FF',
						success: res => {
							if (res.confirm) {}
						}
					})
				}
				this.$refs.loading.closeLoading();
			},
			// 发起解约--------机构：取消
			terminationCancel() {
				this.terminationModal = false
				this.rescissionReason = ''
			},
			// 取消解约---机构发起
			cancelRescindClick() {
				this.cancelRescindModal = true
			},
			// 取消解约---机构发起：确定
			async cancelRescindConfirm() {
				this.$refs.loading.openLoading('取消中···');
				const data = await this.$http.post({
					url: `/project/cancelRescissionV2/${this.maintenanceDetails.id}`
				});
				// console.log('取消解约-合同-----', data);
				if (data.code == 200) {
					this.$refs.uToast.show({
						title: data.msg,
						type: 'success'
					});
					this.getMaintenanceDetails(this.maintenanceDetails.id); // 获取维保详情页数据
				} else {
					uni.showModal({
						title: '温馨提醒',
						content: data.msg,
						showCancel: false,
						confirmColor: '#3178FF',
						success: res => {
							if (res.confirm) {}
						}
					})
				}
				this.$refs.loading.closeLoading();
			},
			// 确定---解约合同（单位发起的）
			confirmRescindClick() {
				this.confirmRescindModal = true;
			},
			// 确定---解约合同（单位发起的）
			async confirmRescindConfirm() {
				this.$refs.loading.openLoading('解约中···');
				const data = await this.$http.post({
					url: `/project/rescission/confirmV2/${this.maintenanceDetails.id}`
				});
				// console.log('确定---解约合同（单位发起的）-----', data);
				if (data.code == 200) {
					this.$refs.uToast.show({
						title: data.msg,
						type: 'success'
					});
					this.getMaintenanceDetails(this.maintenanceDetails.id); // 获取维保详情页数据
				} else {
					uni.showModal({
						title: '温馨提醒',
						content: data.msg,
						showCancel: false,
						confirmColor: '#3178FF',
						success: res => {
							if (res.confirm) {}
						}
					})
				}
				this.$refs.loading.closeLoading();
			},
			// 跳转详细的需求详情页数据
			demandDetailsClick() {
				this.$pageJump.navigateTo('/pages/maintenance/public/demand/demandDetails?id=' + this
					.params
					.projectId);
			},
			// 跳转维保详情页面
			mechanismDetailsClick(item) {
				this.$pageJump.navigateTo('/pages/maintenance/mechanism/home/components/details/Report?id=' +
					item.id);
			},
			// 跳转到报告书页面
			vieWReportClick(item) {
				if (item.reportQrcodeUrl != '' && item.reportQrcodeUrl != null) {
					this.$pageJump.navigateTo(
						'/pages/maintenance/mechanism/home/components/details/Report?id=' + item.id);
				} else {
					this.reportModal = true; // 提示无法查看报告书
				}
			},
			// 作废本次维保---打开弹框
			// 作废本次维保前校验
			async voidMechanismClick(item) {
				let that = this
				this.$refs.loading.openLoading('校验中···');
				const data = await this.$http.post({
					url: `/maintenance/cancelCheck/?id=` + item.id
				})
				// console.log('作废本次维保前校验', data)
				if (data.code == 200) {
					if (data.data.status == 1) {
						uni.showModal({
							title: '温馨提示',
							content: data.data.msg,
							confirmColor: '#3178FF',
							cancelColor: '#606266',
							success: res => {
								if (res.confirm) {
									that.voidMechanismClick1(item.id)
								}
							}
						});
					} else {
						that.voidMechanismClick1(item.id)
					}
				} else {
					this.$refs.uToast.show({
						title: data.msg,
						type: 'error'
					});
				}
				this.$refs.loading.closeLoading();
			},
			voidMechanismClick1(id) {
				this.voidId = id;
				this.voidModal = true;
			},
			// 作废本次维保---确定操作
			voidConfirm() {
				this.voidModal = true;
				if (!this.reason) {
					this.$refs.uToast.show({
						title: '请输入作废原因',
						type: 'error'
					});
					return
				}
				this.$refs.loading.openLoading('作废中···');
				let params = {
					id: this.voidId,
					reason: this.reason
				}
				this.$http.post({
					url: '/maintenance/cancel',
					data: params
				}).then(res => {
					// console.log('作废本次维保返回的结果数据-----', res);
					this.$refs.loading.closeLoading();
					this.reason = ''
					if (res.code == 200) {
						this.$refs.uToast.show({
							title: res.msg,
							type: 'success'
						});
						this.voidModal = false;
						this.getMaintenanceDetails(this.maintenanceDetails.id); // 获取维保详情页数据
					} else {
						this.$refs.uToast.show({
							title: res.msg,
							type: 'error'
						});
					}
				});
			},
			// 维保结束后，可再次发起维保
			launchMechanismClick() {
				this.$refs.loading.openLoading('发起维保中···');
				let params = {
					projectId: this.maintenanceDetails.id
				};
				this.$http.post({
					url: `/serviceOrg/remaint/V2`,
					data: params
				}).then(res => {
					// console.log('维保结束后，可再次发起维保结果返回的数据-----', res);
					this.$refs.loading.closeLoading();
					if (res.code == 200) {
						this.$refs.uToast.show({
							title: res.msg,
							type: 'success'
						});
						this.getMaintenanceDetails(this.maintenanceDetails.id); // 获取维保详情页数据
						this.launchModal = true; // 维保结束后，可再次发起维保---打开弹窗
					} else {
						uni.showModal({
							title: '温馨提醒',
							content: res.msg,
							showCancel: false,
							confirmColor: '#3178FF',
							success: res => {
								if (res.confirm) {}
							}
						})
					}
				});
			},
			// 维保结束后，可再次发起维保---确认操作
			launchConfirm() {
				this.$pageJump.reLaunch('/pages/maintenance/mechanism/Maintenance');
			}
		},
		onShareAppMessage() {
			return {
				title: '分享小程序给朋友',
				path: '/pages/homePage/Home'
			};
		}
	};
</script>

<style lang="scss" scoped>
	@import './components/projectDetails.scss';

	.projectDetails-header {
		padding-bottom: 1220rpx;
	}

	.projectDetails-termrecord {
		padding: 30rpx 40rpx 10rpx;
		margin: 20rpx 24rpx;
		background-image: linear-gradient(#FFEBEB 13%, #ffffff 35%);

		.ff-font-16 {
			color: #F31C01;
			margin-bottom: 30rpx;
		}

		.ff-flex {
			margin-bottom: 20rpx;

			.ff-color-999 {
				width: 221rpx;

			}
		}

	}

	.tips1,
	.tips2 {
		margin-bottom: 8.5rpx !important;
	}

	.tips3 {
		margin-top: 0 !important;
	}

	textarea {
		width: 92%;
		border: 2rpx solid #999;
		height: 200rpx;
	}

	.ff-width-110 {
		width: 220rpx;
	}

	.ff-width-180 {
		width: 360rpx;
		word-wrap: break-word; // 让数字字母强制换行
	}
</style>